<?php 
/**
* filter class sq1AbbrevInput
* type: input
* return: mixed
*/

class filterSq1AbbrevInput extends bookstoreInputFilter{

	
	function __construct(){
		$this->type = 'input';
		$this->name = 'sq1AbbrevInput';
	
	}//end constructor

	/**
	* look for specific words and replace them
	*/
	function filter($return_type,&$input){
		
		/// strip hyphens from isbn
		// NOTE: this probably should be its own filter
		foreach($input as $key=>$value){
		//	if(is_array($value)){
		//		foreach($value as $k=>$v){
		//			if(preg_match("/^[0-9][0-9-][0-9-][0-9-][0-9-][0-9-][0-9-][0-9-][0-9-][0-9-]./",$v) ){
		//				$value[$k]=$preg_replace("/-/","",$v);
		//			}//end if
		//		}//end foreach k=>v
		//		$input[$key] = $value;
		//	}else{
				if(preg_match("/^[0-9][0-9-][0-9-][0-9-][0-9-][0-9-][0-9-][0-9-][0-9-][0-9-]/",$value) ){
						$input[$key]= preg_replace("/-/","",$value);
					}//end if
		//	}//end if array
			
		}//end foreach input
				//var_dump($input);		
		return $input;
	}
	
}//end filterSq2AbbrvInput class

?>
